<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: event   CustomEvent.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>Event Utility&nbsp; <span class="subtitle">2.9.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_event.html" title="event">event</a>
                
                 &gt; CustomEvent.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="cm">/**</span>
<span class="cm"> * The CustomEvent class lets you define events for your application</span>
<span class="cm"> * that can be subscribed to by one or more independent component.</span>
<span class="cm"> *</span>
<span class="cm"> * @param {String}  type The type of event, which is passed to the callback</span>
<span class="cm"> *                  when the event fires</span>
<span class="cm"> * @param {Object}  context The context the event will fire from.  &quot;this&quot; will</span>
<span class="cm"> *                  refer to this object in the callback.  Default value:</span>
<span class="cm"> *                  the window object.  The listener can override this.</span>
<span class="cm"> * @param {boolean} silent pass true to prevent the event from writing to</span>
<span class="cm"> *                  the debugsystem</span>
<span class="cm"> * @param {int}     signature the signature that the custom event subscriber</span>
<span class="cm"> *                  will receive. YAHOO.util.CustomEvent.LIST or</span>
<span class="cm"> *                  YAHOO.util.CustomEvent.FLAT.  The default is</span>
<span class="cm"> *                  YAHOO.util.CustomEvent.LIST.</span>
<span class="cm"> * @param fireOnce {boolean} If configured to fire once, the custom event</span>
<span class="cm"> * will only notify subscribers a single time regardless of how many times</span>
<span class="cm"> * the event is fired.  In addition, new subscribers will be notified</span>
<span class="cm"> * immediately if the event has already been fired.</span>
<span class="cm"> * @namespace YAHOO.util</span>
<span class="cm"> * @class CustomEvent</span>
<span class="cm"> * @constructor</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">type</span><span class="p">,</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">silent</span><span class="p">,</span> <span class="nx">signature</span><span class="p">,</span> <span class="nx">fireOnce</span><span class="p">)</span> <span class="p">{</span>

    <span class="cm">/**</span>
<span class="cm">     * The type of event, returned to subscribers when the event fires</span>
<span class="cm">     * @property type</span>
<span class="cm">     * @type string</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">type</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * The context the event will fire from by default. Defaults to the window obj.</span>
<span class="cm">     * @property scope</span>
<span class="cm">     * @type object</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">scope</span> <span class="o">=</span> <span class="nx">context</span> <span class="o">||</span> <span class="nb">window</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * By default all custom events are logged in the debug build. Set silent to true</span>
<span class="cm">     * to disable debug output for this event.</span>
<span class="cm">     * @property silent</span>
<span class="cm">     * @type boolean</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">silent</span> <span class="o">=</span> <span class="nx">silent</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * If configured to fire once, the custom event will only notify subscribers</span>
<span class="cm">     * a single time regardless of how many times the event is fired.  In addition,</span>
<span class="cm">     * new subscribers will be notified immediately if the event has already been</span>
<span class="cm">     * fired.</span>
<span class="cm">     * @property fireOnce</span>
<span class="cm">     * @type boolean</span>
<span class="cm">     * @default false</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireOnce</span> <span class="o">=</span> <span class="nx">fireOnce</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * Indicates whether or not this event has ever been fired.</span>
<span class="cm">     * @property fired</span>
<span class="cm">     * @type boolean</span>
<span class="cm">     * @default false</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fired</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * For fireOnce events the arguments the event was fired with are stored</span>
<span class="cm">     * so that new subscribers get the proper payload.</span>
<span class="cm">     * @property firedWith</span>
<span class="cm">     * @type Array</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">firedWith</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * Custom events support two styles of arguments provided to the event</span>
<span class="cm">     * subscribers.</span>
<span class="cm">     * &lt;ul&gt;</span>
<span class="cm">     * &lt;li&gt;YAHOO.util.CustomEvent.LIST:</span>
<span class="cm">     *   &lt;ul&gt;</span>
<span class="cm">     *   &lt;li&gt;param1: event name&lt;/li&gt;</span>
<span class="cm">     *   &lt;li&gt;param2: array of arguments sent to fire&lt;/li&gt;</span>
<span class="cm">     *   &lt;li&gt;param3: &lt;optional&gt; a custom object supplied by the subscriber&lt;/li&gt;</span>
<span class="cm">     *   &lt;/ul&gt;</span>
<span class="cm">     * &lt;/li&gt;</span>
<span class="cm">     * &lt;li&gt;YAHOO.util.CustomEvent.FLAT</span>
<span class="cm">     *   &lt;ul&gt;</span>
<span class="cm">     *   &lt;li&gt;param1: the first argument passed to fire.  If you need to</span>
<span class="cm">     *           pass multiple parameters, use and array or object literal&lt;/li&gt;</span>
<span class="cm">     *   &lt;li&gt;param2: &lt;optional&gt; a custom object supplied by the subscriber&lt;/li&gt;</span>
<span class="cm">     *   &lt;/ul&gt;</span>
<span class="cm">     * &lt;/li&gt;</span>
<span class="cm">     * &lt;/ul&gt;</span>
<span class="cm">     *   @property signature</span>
<span class="cm">     *   @type int</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">signature</span> <span class="o">=</span> <span class="nx">signature</span> <span class="o">||</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">LIST</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * The subscribers to this event</span>
<span class="cm">     * @property subscribers</span>
<span class="cm">     * @type Subscriber[]</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span> <span class="o">=</span> <span class="p">[];</span>

    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="s2">&quot;Creating &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span> <span class="p">);</span>
    <span class="p">}</span>

    <span class="kd">var</span> <span class="nx">onsubscribeType</span> <span class="o">=</span> <span class="s2">&quot;_YUICEOnSubscribe&quot;</span><span class="p">;</span>

    <span class="c1">// Only add subscribe events for events that are not generated by</span>
    <span class="c1">// CustomEvent</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">type</span> <span class="o">!==</span> <span class="nx">onsubscribeType</span><span class="p">)</span> <span class="p">{</span>

        <span class="cm">/**</span>
<span class="cm">         * Custom events provide a custom event that fires whenever there is</span>
<span class="cm">         * a new subscriber to the event.  This provides an opportunity to</span>
<span class="cm">         * handle the case where there is a non-repeating event that has</span>
<span class="cm">         * already fired has a new subscriber.</span>
<span class="cm">         *</span>
<span class="cm">         * @event subscribeEvent</span>
<span class="cm">         * @type YAHOO.util.CustomEvent</span>
<span class="cm">         * @param fn {Function} The function to execute</span>
<span class="cm">         * @param obj &lt;Object&gt; An object to be passed along when the event fires.</span>
<span class="cm">         * Defaults to the custom event.</span>
<span class="cm">         * @param override &lt;boolean|Object&gt; If true, the obj passed in becomes the</span>
<span class="cm">         * execution context of the listener. If an object, that object becomes</span>
<span class="cm">         * the execution context. Defaults to the custom event.</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">subscribeEvent</span> <span class="o">=</span>
                <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">(</span><span class="nx">onsubscribeType</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

    <span class="p">}</span>


    <span class="cm">/**</span>
<span class="cm">     * In order to make it possible to execute the rest of the subscriber</span>
<span class="cm">     * stack when one thows an exception, the subscribers exceptions are</span>
<span class="cm">     * caught.  The most recent exception is stored in this property</span>
<span class="cm">     * @property lastError</span>
<span class="cm">     * @type Error</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">lastError</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">};</span>

<span class="cm">/**</span>
<span class="cm"> * Subscriber listener sigature constant.  The LIST type returns three</span>
<span class="cm"> * parameters: the event type, the array of args passed to fire, and</span>
<span class="cm"> * the optional custom object</span>
<span class="cm"> * @property YAHOO.util.CustomEvent.LIST</span>
<span class="cm"> * @static</span>
<span class="cm"> * @type int</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">LIST</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>

<span class="cm">/**</span>
<span class="cm"> * Subscriber listener sigature constant.  The FLAT type returns two</span>
<span class="cm"> * parameters: the first argument passed to fire and the optional</span>
<span class="cm"> * custom object</span>
<span class="cm"> * @property YAHOO.util.CustomEvent.FLAT</span>
<span class="cm"> * @static</span>
<span class="cm"> * @type int</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">FLAT</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>

<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>

    <span class="cm">/**</span>
<span class="cm">     * Subscribes the caller to this event</span>
<span class="cm">     * @method subscribe</span>
<span class="cm">     * @param {Function} fn        The function to execute</span>
<span class="cm">     * @param {Object}   obj       An object to be passed along when the event</span>
<span class="cm">     * fires.</span>
<span class="cm">     * @param {boolean|Object} overrideContext If true, the obj passed in</span>
<span class="cm">     * becomes the execution.</span>
<span class="cm">     * context of the listener. If an object, that object becomes the execution</span>
<span class="cm">     * context.</span>
<span class="cm">     */</span>
    <span class="nx">subscribe</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">,</span> <span class="nx">overrideContext</span><span class="p">)</span> <span class="p">{</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">fn</span><span class="p">)</span> <span class="p">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;Invalid callback for subscriber to &#39;&quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">subscribeEvent</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">subscribeEvent</span><span class="p">.</span><span class="nx">fire</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">,</span> <span class="nx">overrideContext</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">,</span> <span class="nx">overrideContext</span><span class="p">);</span>

        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fireOnce</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">fired</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">firedWith</span><span class="p">);</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">s</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Unsubscribes subscribers.</span>
<span class="cm">     * @method unsubscribe</span>
<span class="cm">     * @param {Function} fn  The subscribed function to remove, if not supplied</span>
<span class="cm">     *                       all will be removed</span>
<span class="cm">     * @param {Object}   obj  The custom object passed to subscribe.  This is</span>
<span class="cm">     *                        optional, but if supplied will be used to</span>
<span class="cm">     *                        disambiguate multiple listeners that are the same</span>
<span class="cm">     *                        (e.g., you subscribe many object using a function</span>
<span class="cm">     *                        that lives on the prototype)</span>
<span class="cm">     * @return {boolean} True if the subscriber was found and detached.</span>
<span class="cm">     */</span>
    <span class="nx">unsubscribe</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">fn</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">();</span>
        <span class="p">}</span>

        <span class="kd">var</span> <span class="nx">found</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">s</span> <span class="o">&amp;&amp;</span> <span class="nx">s</span><span class="p">.</span><span class="nx">contains</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_delete</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                <span class="nx">found</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="k">return</span> <span class="nx">found</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Notifies the subscribers.  The callback functions will be executed</span>
<span class="cm">     * from the context specified when the event was created, and with the</span>
<span class="cm">     * following parameters:</span>
<span class="cm">     *   &lt;ul&gt;</span>
<span class="cm">     *   &lt;li&gt;The type of event&lt;/li&gt;</span>
<span class="cm">     *   &lt;li&gt;All of the arguments fire() was executed with as an array&lt;/li&gt;</span>
<span class="cm">     *   &lt;li&gt;The custom object (if any) that was passed into the subscribe()</span>
<span class="cm">     *       method&lt;/li&gt;</span>
<span class="cm">     *   &lt;/ul&gt;</span>
<span class="cm">     * @method fire</span>
<span class="cm">     * @param {Object*} arguments an arbitrary set of parameters to pass to</span>
<span class="cm">     *                            the handler.</span>
<span class="cm">     * @return {boolean} false if one of the subscribers returned false,</span>
<span class="cm">     *                   true otherwise</span>
<span class="cm">     */</span>
    <span class="nx">fire</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">lastError</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="kd">var</span> <span class="nx">errors</span> <span class="o">=</span> <span class="p">[],</span>
            <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>


        <span class="kd">var</span> <span class="nx">args</span><span class="o">=</span><span class="p">[].</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">arguments</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="nx">ret</span><span class="o">=</span><span class="kc">true</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">rebuild</span><span class="o">=</span><span class="kc">false</span><span class="p">;</span>

        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fireOnce</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fired</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;fireOnce event has already fired: &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
                <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">firedWith</span> <span class="o">=</span> <span class="nx">args</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">fired</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">len</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">//YAHOO.log(&#39;DEBUG no subscribers&#39;);</span>
            <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="s2">&quot;Firing &quot;</span>       <span class="o">+</span> <span class="k">this</span>  <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span>
                       <span class="s2">&quot;args: &quot;</span>        <span class="o">+</span> <span class="nx">args</span>  <span class="o">+</span> <span class="s2">&quot;, &quot;</span> <span class="o">+</span>
                       <span class="s2">&quot;subscribers: &quot;</span> <span class="o">+</span> <span class="nx">len</span><span class="p">,</span>
                       <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span>                  <span class="p">);</span>
        <span class="p">}</span>

        <span class="c1">// make a copy of the subscribers so that there are</span>
        <span class="c1">// no index problems if one subscriber removes another.</span>
        <span class="kd">var</span> <span class="nx">subs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">slice</span><span class="p">();</span>

        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">subs</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">s</span> <span class="o">||</span> <span class="o">!</span><span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">rebuild</span><span class="o">=</span><span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>

                <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span>

                <span class="k">if</span> <span class="p">(</span><span class="kc">false</span> <span class="o">===</span> <span class="nx">ret</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Event stopped, sub &quot;</span> <span class="o">+</span> <span class="nx">i</span> <span class="o">+</span> <span class="s2">&quot; of &quot;</span> <span class="o">+</span> <span class="nx">len</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span><span class="p">);</span>
                    <span class="p">}</span>

                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="k">return</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">!==</span> <span class="kc">false</span><span class="p">);</span>
    <span class="p">},</span>

    <span class="nx">notify</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>

        <span class="kd">var</span> <span class="nx">ret</span><span class="p">,</span> <span class="nx">param</span><span class="o">=</span><span class="kc">null</span><span class="p">,</span> <span class="nx">scope</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">getScope</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">),</span>
                 <span class="nx">throwErrors</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">throwErrors</span><span class="p">;</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">silent</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s2">&quot;-&gt; &quot;</span> <span class="o">+</span> <span class="nx">s</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span> <span class="p">);</span>
        <span class="p">}</span>

        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">signature</span> <span class="o">==</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">CustomEvent</span><span class="p">.</span><span class="nx">FLAT</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">args</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">param</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
            <span class="p">}</span>

            <span class="k">try</span> <span class="p">{</span>
                <span class="nx">ret</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">scope</span><span class="p">,</span> <span class="nx">param</span><span class="p">,</span> <span class="nx">s</span><span class="p">.</span><span class="nx">obj</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">lastError</span> <span class="o">=</span> <span class="nx">e</span><span class="p">;</span>
                <span class="c1">// errors.push(e);</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span> <span class="o">+</span> <span class="s2">&quot; subscriber exception: &quot;</span> <span class="o">+</span> <span class="nx">e</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">throwErrors</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">throw</span> <span class="nx">e</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="nx">ret</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">scope</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span><span class="p">,</span> <span class="nx">args</span><span class="p">,</span> <span class="nx">s</span><span class="p">.</span><span class="nx">obj</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">ex</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">lastError</span> <span class="o">=</span> <span class="nx">ex</span><span class="p">;</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">this</span> <span class="o">+</span> <span class="s2">&quot; subscriber exception: &quot;</span> <span class="o">+</span> <span class="nx">ex</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="s2">&quot;Event&quot;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">throwErrors</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">throw</span> <span class="nx">ex</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Removes all listeners</span>
<span class="cm">     * @method unsubscribeAll</span>
<span class="cm">     * @return {int} The number of listeners unsubscribed</span>
<span class="cm">     */</span>
    <span class="nx">unsubscribeAll</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">i</span><span class="p">;</span>
        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">l</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_delete</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="o">=</span><span class="p">[];</span>

        <span class="k">return</span> <span class="nx">l</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * @method _delete</span>
<span class="cm">     * @private</span>
<span class="cm">     */</span>
    <span class="nx">_delete</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">[</span><span class="nx">index</span><span class="p">];</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">delete</span> <span class="nx">s</span><span class="p">.</span><span class="nx">fn</span><span class="p">;</span>
            <span class="k">delete</span> <span class="nx">s</span><span class="p">.</span><span class="nx">obj</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="c1">// this.subscribers[index]=null;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">subscribers</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">index</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * @method toString</span>
<span class="cm">     */</span>
    <span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
         <span class="k">return</span> <span class="s2">&quot;CustomEvent: &quot;</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">type</span>  <span class="o">+</span> <span class="s2">&quot;&#39;, &quot;</span> <span class="o">+</span>
             <span class="s2">&quot;context: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">;</span>

    <span class="p">}</span>
<span class="p">};</span>

<span class="c1">/////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Stores the subscriber information to be used when the event fires.</span>
<span class="cm"> * @param {Function} fn       The function to execute</span>
<span class="cm"> * @param {Object}   obj      An object to be passed along when the event fires</span>
<span class="cm"> * @param {boolean}  overrideContext If true, the obj passed in becomes the execution</span>
<span class="cm"> *                            context of the listener</span>
<span class="cm"> * @class Subscriber</span>
<span class="cm"> * @constructor</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Subscriber</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">,</span> <span class="nx">overrideContext</span><span class="p">)</span> <span class="p">{</span>

    <span class="cm">/**</span>
<span class="cm">     * The callback that will be execute when the event fires</span>
<span class="cm">     * @property fn</span>
<span class="cm">     * @type function</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">=</span> <span class="nx">fn</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * An optional custom object that will passed to the callback when</span>
<span class="cm">     * the event fires</span>
<span class="cm">     * @property obj</span>
<span class="cm">     * @type object</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">obj</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isUndefined</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">?</span> <span class="kc">null</span> <span class="o">:</span> <span class="nx">obj</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * The default execution context for the event listener is defined when the</span>
<span class="cm">     * event is created (usually the object which contains the event).</span>
<span class="cm">     * By setting overrideContext to true, the execution context becomes the custom</span>
<span class="cm">     * object passed in by the subscriber.  If overrideContext is an object, that</span>
<span class="cm">     * object becomes the context.</span>
<span class="cm">     * @property overrideContext</span>
<span class="cm">     * @type boolean|object</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">overrideContext</span> <span class="o">=</span> <span class="nx">overrideContext</span><span class="p">;</span>

<span class="p">};</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the execution context for this listener.  If overrideContext was set to true</span>
<span class="cm"> * the custom obj will be the context.  If overrideContext is an object, that is the</span>
<span class="cm"> * context, otherwise the default context will be used.</span>
<span class="cm"> * @method getScope</span>
<span class="cm"> * @param {Object} defaultScope the context to use if this listener does not</span>
<span class="cm"> *                              override it.</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">getScope</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">defaultScope</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">overrideContext</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">overrideContext</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">obj</span><span class="p">;</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">overrideContext</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">defaultScope</span><span class="p">;</span>
<span class="p">};</span>

<span class="cm">/**</span>
<span class="cm"> * Returns true if the fn and obj match this objects properties.</span>
<span class="cm"> * Used by the unsubscribe method to match the right subscriber.</span>
<span class="cm"> *</span>
<span class="cm"> * @method contains</span>
<span class="cm"> * @param {Function} fn the function to execute</span>
<span class="cm"> * @param {Object} obj an object to be passed along when the event fires</span>
<span class="cm"> * @return {boolean} true if the supplied arguments match this</span>
<span class="cm"> *                   subscriber&#39;s signature.</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">contains</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">==</span> <span class="nx">fn</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">obj</span> <span class="o">==</span> <span class="nx">obj</span><span class="p">);</span>
    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
        <span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fn</span> <span class="o">==</span> <span class="nx">fn</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">};</span>

<span class="cm">/**</span>
<span class="cm"> * @method toString</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Subscriber</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">toString</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="s2">&quot;Subscriber { obj: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">obj</span>  <span class="o">+</span>
           <span class="s2">&quot;, overrideContext: &quot;</span> <span class="o">+</span>  <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">overrideContext</span> <span class="o">||</span> <span class="s2">&quot;no&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; }&quot;</span><span class="p">;</span>
<span class="p">};</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class="selected"><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.util.CustomEvent.html" title="YAHOO.util.CustomEvent">YAHOO.util.CustomEvent</a></li>
                                <li class=""><a href="YAHOO.util.Event.html" title="YAHOO.util.Event">YAHOO.util.Event</a></li>
                                <li class=""><a href="YAHOO.util.EventProvider.html" title="YAHOO.util.EventProvider">YAHOO.util.EventProvider</a></li>
                                <li class=""><a href="YAHOO.util.KeyListener.html" title="YAHOO.util.KeyListener">YAHOO.util.KeyListener</a></li>
                                <li class=""><a href="YAHOO.util.Subscriber.html" title="YAHOO.util.Subscriber">YAHOO.util.Subscriber</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="CustomEvent.js.html" title="CustomEvent.js">CustomEvent.js</a></li>
                                <li class=""><a href="Event.js.html" title="Event.js">Event.js</a></li>
                                <li class=""><a href="EventProvider.js.html" title="EventProvider.js">EventProvider.js</a></li>
                                <li class=""><a href="KeyListener.js.html" title="KeyListener.js">KeyListener.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.util.Event", "name": "addBlurListener", "url": "YAHOO.util.Event.html#method_addBlurListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "addFocusListener", "url": "YAHOO.util.Event.html#method_addFocusListener", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_addListener", "url": "YAHOO.util.Event.html#method__addListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "addListener", "url": "YAHOO.util.Event.html#method_addListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "ADJ_SCOPE", "url": "YAHOO.util.Event.html#property_ADJ_SCOPE", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "CAPTURE", "url": "YAHOO.util.Event.html#property_CAPTURE", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "clearCache", "url": "YAHOO.util.Event.html#method_clearCache", "type": "method"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "contains", "url": "YAHOO.util.Subscriber.html#method_contains", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "counter", "url": "YAHOO.util.Event.html#property_counter", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_createDelegate", "url": "YAHOO.util.Event.html#method__createDelegate", "type": "method"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "createEvent", "url": "YAHOO.util.EventProvider.html#method_createEvent", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_createMouseDelegate", "url": "YAHOO.util.Event.html#method__createMouseDelegate", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "delegate", "url": "YAHOO.util.Event.html#method_delegate", "type": "method"}, {"access": "private", "host": "YAHOO.util.CustomEvent", "name": "_delete", "url": "YAHOO.util.CustomEvent.html#method__delete", "type": "method"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "disable", "url": "YAHOO.util.KeyListener.html#method_disable", "type": "method"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "disabledEvent", "url": "YAHOO.util.KeyListener.html#event_disabledEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.Event", "name": "DOMReady", "url": "YAHOO.util.Event.html#property_DOMReady", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "DOMReadyEvent", "url": "YAHOO.util.Event.html#event_DOMReadyEvent", "type": "event"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_dri", "url": "YAHOO.util.Event.html#property__dri", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "EL", "url": "YAHOO.util.Event.html#property_EL", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "elCache\nDOM element cache", "url": "YAHOO.util.Event.html#property_elCache\nDOM element cache", "type": "property"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "enable", "url": "YAHOO.util.KeyListener.html#method_enable", "type": "method"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "enabled", "url": "YAHOO.util.KeyListener.html#property_enabled", "type": "property"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "enabledEvent", "url": "YAHOO.util.KeyListener.html#event_enabledEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "fire", "url": "YAHOO.util.CustomEvent.html#method_fire", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "fired", "url": "YAHOO.util.CustomEvent.html#property_fired", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "firedWith", "url": "YAHOO.util.CustomEvent.html#property_firedWith", "type": "property"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "fireEvent", "url": "YAHOO.util.EventProvider.html#method_fireEvent", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "fireOnce", "url": "YAHOO.util.CustomEvent.html#property_fireOnce", "type": "property"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "fn", "url": "YAHOO.util.Subscriber.html#property_fn", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "FN", "url": "YAHOO.util.Event.html#property_FN", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "generateId", "url": "YAHOO.util.Event.html#method_generateId", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_getCacheIndex", "url": "YAHOO.util.Event.html#method__getCacheIndex", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getCharCode", "url": "YAHOO.util.Event.html#method_getCharCode", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "getEl", "url": "YAHOO.util.Event.html#method_getEl", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getEvent", "url": "YAHOO.util.Event.html#method_getEvent", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getListeners", "url": "YAHOO.util.Event.html#method_getListeners", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getPageX", "url": "YAHOO.util.Event.html#method_getPageX", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getPageY", "url": "YAHOO.util.Event.html#method_getPageY", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getRelatedTarget", "url": "YAHOO.util.Event.html#method_getRelatedTarget", "type": "method"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "getScope", "url": "YAHOO.util.Subscriber.html#method_getScope", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_getScroll", "url": "YAHOO.util.Event.html#method__getScroll", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_getScrollLeft", "url": "YAHOO.util.Event.html#method__getScrollLeft", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_getScrollTop", "url": "YAHOO.util.Event.html#method__getScrollTop", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getTarget", "url": "YAHOO.util.Event.html#method_getTarget", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getTime", "url": "YAHOO.util.Event.html#method_getTime", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_getType", "url": "YAHOO.util.Event.html#method__getType", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "getXY", "url": "YAHOO.util.Event.html#method_getXY", "type": "method"}, {"access": "private", "host": "YAHOO.util.KeyListener", "name": "handleKeyPress", "url": "YAHOO.util.KeyListener.html#method_handleKeyPress", "type": "method"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "hasEvent", "url": "YAHOO.util.EventProvider.html#method_hasEvent", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_interval", "url": "YAHOO.util.Event.html#property__interval", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "isIE", "url": "YAHOO.util.Event.html#property_isIE", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "isSafari", "url": "YAHOO.util.Event.html#property_isSafari", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_isValidCollection", "url": "YAHOO.util.Event.html#method__isValidCollection", "type": "method"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "KEY", "url": "YAHOO.util.KeyListener.html#property_KEY", "type": "property"}, {"access": "private", "host": "YAHOO.util.KeyListener", "name": "keyEvent", "url": "YAHOO.util.KeyListener.html#event_keyEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "lastError", "url": "YAHOO.util.CustomEvent.html#property_lastError", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "lastError", "url": "YAHOO.util.Event.html#property_lastError", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "listeners", "url": "YAHOO.util.Event.html#property_listeners", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_load", "url": "YAHOO.util.Event.html#method__load", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "loadComplete", "url": "YAHOO.util.Event.html#property_loadComplete", "type": "property"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "obj", "url": "YAHOO.util.Subscriber.html#property_obj", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "OBJ", "url": "YAHOO.util.Event.html#property_OBJ", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "on", "url": "YAHOO.util.Event.html#method_on", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "onAvailable", "url": "YAHOO.util.Event.html#method_onAvailable", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "onAvailStack", "url": "YAHOO.util.Event.html#property_onAvailStack", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "onBlur", "url": "YAHOO.util.Event.html#method_onBlur", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "onContentReady", "url": "YAHOO.util.Event.html#method_onContentReady", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "onDOMReady", "url": "YAHOO.util.Event.html#method_onDOMReady", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "onFocus", "url": "YAHOO.util.Event.html#method_onFocus", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "OVERRIDE", "url": "YAHOO.util.Event.html#property_OVERRIDE", "type": "property"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "overrideContext", "url": "YAHOO.util.Subscriber.html#property_overrideContext", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "POLL_INTERVAL", "url": "YAHOO.util.Event.html#property_POLL_INTERVAL", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "POLL_RETRYS", "url": "YAHOO.util.Event.html#property_POLL_RETRYS", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "preventDefault", "url": "YAHOO.util.Event.html#method_preventDefault", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "purgeElement", "url": "YAHOO.util.Event.html#method_purgeElement", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_ready", "url": "YAHOO.util.Event.html#method__ready", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "regCE", "url": "YAHOO.util.Event.html#method_regCE", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "removeBlurListener", "url": "YAHOO.util.Event.html#method_removeBlurListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "removeDelegate", "url": "YAHOO.util.Event.html#method_removeDelegate", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "removeFocusListener", "url": "YAHOO.util.Event.html#method_removeFocusListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "removeListener", "url": "YAHOO.util.Event.html#method_removeListener", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "resolveTextNode", "url": "YAHOO.util.Event.html#method_resolveTextNode", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "retryCount", "url": "YAHOO.util.Event.html#property_retryCount", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "scope", "url": "YAHOO.util.CustomEvent.html#property_scope", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "signature", "url": "YAHOO.util.CustomEvent.html#property_signature", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "silent", "url": "YAHOO.util.CustomEvent.html#property_silent", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_simpleAdd", "url": "YAHOO.util.Event.html#method__simpleAdd", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_simpleRemove", "url": "YAHOO.util.Event.html#method__simpleRemove", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_specialTypes", "url": "YAHOO.util.Event.html#property__specialTypes", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "startInterval", "url": "YAHOO.util.Event.html#method_startInterval", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "stopEvent", "url": "YAHOO.util.Event.html#method_stopEvent", "type": "method"}, {"access": "", "host": "YAHOO.util.Event", "name": "stopPropagation", "url": "YAHOO.util.Event.html#method_stopPropagation", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "subscribe", "url": "YAHOO.util.CustomEvent.html#method_subscribe", "type": "method"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "subscribe", "url": "YAHOO.util.EventProvider.html#method_subscribe", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "subscribeEvent", "url": "YAHOO.util.CustomEvent.html#event_subscribeEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "subscribers", "url": "YAHOO.util.CustomEvent.html#property_subscribers", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "throwErrors", "url": "YAHOO.util.Event.html#property_throwErrors", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "toString", "url": "YAHOO.util.CustomEvent.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.util.Subscriber", "name": "toString", "url": "YAHOO.util.Subscriber.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "toString", "url": "YAHOO.util.KeyListener.html#method_toString", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_tryPreloadAttach", "url": "YAHOO.util.Event.html#method__tryPreloadAttach", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "type", "url": "YAHOO.util.CustomEvent.html#property_type", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "TYPE", "url": "YAHOO.util.Event.html#property_TYPE", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "_unload", "url": "YAHOO.util.Event.html#method__unload", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "unloadListeners", "url": "YAHOO.util.Event.html#property_unloadListeners", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "unsubscribe", "url": "YAHOO.util.CustomEvent.html#method_unsubscribe", "type": "method"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "unsubscribe", "url": "YAHOO.util.EventProvider.html#method_unsubscribe", "type": "method"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "unsubscribeAll", "url": "YAHOO.util.CustomEvent.html#method_unsubscribeAll", "type": "method"}, {"access": "", "host": "YAHOO.util.EventProvider", "name": "unsubscribeAll", "url": "YAHOO.util.EventProvider.html#method_unsubscribeAll", "type": "method"}, {"access": "private", "host": "YAHOO.util.Event", "name": "webkit", "url": "YAHOO.util.Event.html#property_webkit", "type": "property"}, {"access": "private", "host": "YAHOO.util.Event", "name": "webkitKeymap", "url": "YAHOO.util.Event.html#property_webkitKeymap", "type": "property"}, {"access": "", "host": "YAHOO.util.Event", "name": "WFN", "url": "YAHOO.util.Event.html#property_WFN", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "YAHOO.util.CustomEvent.FLAT", "url": "YAHOO.util.CustomEvent.html#property_YAHOO.util.CustomEvent.FLAT", "type": "property"}, {"access": "", "host": "YAHOO.util.CustomEvent", "name": "YAHOO.util.CustomEvent.LIST", "url": "YAHOO.util.CustomEvent.html#property_YAHOO.util.CustomEvent.LIST", "type": "property"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "YAHOO.util.KeyListener.KEYDOWN", "url": "YAHOO.util.KeyListener.html#property_YAHOO.util.KeyListener.KEYDOWN", "type": "property"}, {"access": "", "host": "YAHOO.util.KeyListener", "name": "YAHOO.util.KeyListener.KEYUP", "url": "YAHOO.util.KeyListener.html#property_YAHOO.util.KeyListener.KEYUP", "type": "property"}, {"access": "private", "host": "YAHOO.util.EventProvider", "name": "__yui_events", "url": "YAHOO.util.EventProvider.html#property___yui_events", "type": "property"}, {"access": "private", "host": "YAHOO.util.EventProvider", "name": "__yui_subscribers", "url": "YAHOO.util.EventProvider.html#property___yui_subscribers", "type": "property"}];
</script>
</body>
</html>
